<!--
 @description 订单详情-关联订单
 @fileName LinkOrder.vue
 @author zengqiongying
 @created 2021/07/10 13:36:28
-->
<template>
  <div>
    <table-box
      ref="refTable"
      :data="tableData"
      :table-config="tableConfig"
      :other-filters="otherFilters"
      :table-max-height="600"
      :table-sortable="false"
      show-index
    />
  </div>
</template>

<script>
import tabMixin from './mixin'
import { parseTime } from '@/utils'
export default {
  name: 'OrderDetailLinkOrder',
  mixins: [tabMixin],
  data() {
    return {
      tableData: [],
      otherFilters: [], // 表格额外查询条件
      otherRaws: {},
      tableConfig: {
        // interfacePath: `${process.env.VUE_APP_BASE_API}/api/v1/orderLink/page`,
        interfacePath: ``,
        hideSearchBar: true,
        hideFuncBar: true,
        tabIndex: 23,
        buttonGroupCode: 'detail_link_order',
        pageSize: 50,
        sort: 'createTime', // 开单时间
        order: 'desc',
        setting: [
          {
            prop: 'linkType',
            label: '关联关系',
            minWidth: 150,
            type: 'select',
            propEnum: {
              domainCode: 'marketing',
              appCode: 'eco',
              dictTypeCode: 'LINK_TYPE'
            }
          },
          {
            prop: 'createTime',
            label: '关联时间',
            minWidth: 150,
            formatData: ({ createTime }) => {
              return parseTime(createTime)
            }
          },
          {
            prop: 'ecCode',
            label: '电商单号',
            minWidth: 150
          },
          {
            prop: 'orderType',
            label: '订单类型',
            minWidth: 120,
            type: 'select',
            propEnum: {
              domainCode: 'marketing',
              appCode: 'eco',
              dictTypeCode: 'ORDER_TYPE'
            }
          },
          {
            prop: 'ecSkuCode',
            label: '商品编码',
            minWidth: 150
          },
          {
            prop: 'ecSkuName',
            label: '商品名称',
            minWidth: 150
          },
          {
            prop: 'linkFee',
            label: '关联金额',
            width: 100
          }
        ],
        btnList: []
      }
    }
  },
  computed: {

  },
  created() {
    /* this.otherFilters = [
      { id: 'orderId', property: 'orderId', operator: '=', value: this.orderId }
    ] */
  },
  methods: {
    initData() {
      this.tableData = (this.orderData && this.orderData.linkOrderList) || []
      /*  this.otherFilters = [
        { id: 'orderId', property: 'orderId', operator: '=', value: this.orderId }
      ]
      this.$nextTick(() => {
        this.$refs.refTable.initTableData()
      }) */
    }
  }
}

</script>
<style lang='scss' scoped>
</style>
